package cn.wolfcode.luowowo.common.util;

import cn.wolfcode.luowowo.common.exception.LogicException;

public class AssertUtil {

    // 判断指定字符串是否有长度
    // phone
    // msg  没有长度抛出异常信息
    public static void hasLength(String phone, String msg){
        if(phone == null || "".equals(phone.trim())){
            throw new LogicException(msg);
        }
    }

    public static void isEquals(String v1, String v2, String msg) {
        if(v1 == null || v2 == null){
            throw new LogicException("比较参数不能为null");
        }

        if(!v1.equals(v2)){
            throw new LogicException(msg);
        }
    }
}
